package dubbo.service.impl;

import com.xhb.dubbo.api.TestService;
import com.xhb.dubbo.api.UserService;
import com.xhb.dubbo.entity.User;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;


@Service
@Component
public class TestServiceImpl implements TestService {
    @Autowired
    private Environment environment;


    @Override
    public String test(String id) {
        String port = environment.getProperty("server.port");
        String applicationName = environment.getProperty("spring.application.name");
        String dubboName = environment.getProperty("dubbo.application.name");
        System.out.println("端口：" + port);
        System.out.println("服务：" + applicationName);
        System.out.println("dubboName：" + dubboName);
        return "return:" + id;

    }
}
